import request from '@/utils/request'

// 查询流程定义列表
export function listBpmnInfo(query) {
  return request({
    url: '/workflow/bpmnInfo/list',
    method: 'get',
    params: query
  })
}


// 流程文件部署
export function deploy(data) {
  return request({
    headers:{
      "Content-Type":"multipart/form-data;charset=utf-8"
    },
    url: '/workflow/bpmnInfo',
    method: 'post',
    data: data
  })
}

// 删除流程定义
export function delBpmnInfo(bpmnInfoId,deploymentId) {
  return request({
    url: '/workflow/bpmnInfo/'+ bpmnInfoId +"/" + deploymentId,
    method: 'delete'
  })
}

// 查看流程文件/流程图
export function readResource(deploymentId,fileType){
  return request({
    url:'/workflow/bpmnInfo/readResource/'+deploymentId+'/'+fileType,
    method:'get'
  })
}